#pragma once
#include"ser.h"
#include"list.h"

class List
{
	public:
		static List *get_list();
		
		void list_insert(struct bufferevent*,string&,string&);
		
		void list_erase(struct bufferevent*);
		
		const string *get_act(const bufferevent*); 
		
		const string *get_name(const bufferevent*);
		
		void sd_meg(const string&);
	private:
		List();
		List(List&);
		void operator=(List&);
		
		static List *lt;
		Login_list login_list;
};

class Recorder
{
	public:
		static Recorder *get_recorder();
		
		void err_rd(const char*,int n=1);
		
		void run_rd(const char *);
		
		void run_rd(const char *,const bufferevent*);
		
		void dbg_rd(const char *);
		
		~Recorder();
	private:
		Recorder();
		Recorder(Recorder&);
		void operator =(Recorder&);
		
		string get_now_time();
		static Recorder* recorder;	
		ofstream err;
		ofstream run;
		ofstream dbg;
};

class Mysql
{
	public:
		static Mysql *get_Mysql();
		
		MYSQL *get_mysql();
		
		~Mysql();
	private:
		Mysql();
		Mysql(Mysql&);
		void operator =(Mysql);
		
		bool connect();
		
		static Mysql *sql;
		MYSQL _mysql;
};


